package com.ymatou.app.home.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.app.home.parameter.GetLikeProductListBean;
import com.ymatou.app.home.service.GetLikeProductListCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
/**
*获取首页猜你喜欢商品列表接口
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetLikeProductList{
	private static GetLikeProductListBean getlikeproductlistBean;
	private static GetLikeProductListCall getlikeproductlistCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取首页猜你喜欢商品列表接口");
	}

	@Before
	public void caseUp() {
		getlikeproductlistBean=new GetLikeProductListBean();
		getlikeproductlistCall=new GetLikeProductListCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getlikeproductlistCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetLikeProductList_001() {
		Logger.start(true,"获取首页猜你喜欢商品列表成功");
		try {
			getlikeproductlistBean.setPageIndex(1);
			getlikeproductlistBean.setUserId(1113);
			getlikeproductlistBean.setCookieId("autotest");
			getlikeproductlistBean.setIDFA("autotest");
			getlikeproductlistBean.setIMEI("autotest");
			getlikeproductlistCall.setData(getlikeproductlistBean);
			getlikeproductlistCall.callService();			
			Logger.comment("getlikeproductlistCall send:" + getlikeproductlistCall.getEntityString());
			Logger.comment("getlikeproductlistCall response:" + getlikeproductlistCall.getReturnData());
			
			Logger.verifyNotNull(getlikeproductlistCall.getCategorylist(), "验证接口返回categorylist不为空");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}